package bankTest;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.util.ArrayList;

public class UserAccount<User> {
	
	private ArrayList<User> users = new ArrayList<User>();
	
	public UserAccount(){
		File file = new File("user.txt");
		if(file.exists()){
			FileReader fr = new FileReader(file);
			BufferedReader br = new BufferedReader(fr);
			String str;
			while((str = br.readLine()) != null){
				String[] nameAndPsd = str.split(":");
				User user = new User(nameAndPsd[0],nameAndPsd[1]);
			}
		}
	}
	
	public void login(User user) throws FileNotFoundException{
		if(users.size()>0){
			if(users.contains(user)){
				checkMoney(user);
				System.out.println(user);
			}
		}
	}
	
	public void checkMoney(User user) throws FileNotFoundException{
		FileReader save = new FileReader("save.txt");
		
	}
}
